﻿<%@ Control Language="C#" AutoEventWireup="true" Codebehind="LinkManager.ascx.cs"
	Inherits="Framework.Module.LinkSite.Admin.LinkManager" %>
<%@ Register Assembly="Framework.Library" Namespace="Framework.Library.Controls" TagPrefix="cc1" %>

<script runat="server">

	
</script>

<asp:Label ID="lblUpdateStatus" runat="server"></asp:Label>
<table border="0" cellpadding="0" cellspacing="0" width="700">
	<tr>
		<td>
			<cc1:GridView ID="dgLinks" runat="server"  AutoGenerateColumns="False"
				BorderColor="Gainsboro" BorderStyle="Solid" BorderWidth="1px" CellPadding="2" CssClass="Grid"
				Width="100%" OnRowDataBound="dgLinks_RowDataBound" OnRowCommand="dgLinks_RowCommand" OnRowEditing="dgLinks_RowEditing" OnRowCancelingEdit="dgLinks_RowCancelingEdit" OnRowUpdating="dgLinks_RowUpdating" DataKeyNames="Link_ID">
				<AlternatingRowStyle CssClass="Grid_Raw2" />
				<RowStyle CssClass="Grid_Raw1" />
				<HeaderStyle CssClass="Grid_Top" Font-Bold="True" />
				<Columns>
					<asp:BoundField HeaderText="Stt" ReadOnly="True">
						<headerstyle width="5%" />
					</asp:BoundField>
					<asp:BoundField DataField="Link_ID" ReadOnly="True" HeaderText="ID" />
					<asp:TemplateField HeaderText="T&#234;n">					    
						<ItemTemplate>
							<asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Link_Name") %>'
								ID="Label1">
							</asp:Label>
						</ItemTemplate>
						<EditItemTemplate>
							<table cellpadding="0" cellspacing="0" border="0" width="100%">
								<tr>
									<td width="15%">
										<b>Tên</b></td>
									<td>
										<asp:TextBox Width="100%" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Link_Name") %>' ID="txtName"></asp:TextBox>
										</td>
								</tr>
								<tr>
									<td>
										<b>Trỏ tới</b></td>
									<td>
										<asp:TextBox Width="100%" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Link_Target") %>'											ID="txtTarget">
										</asp:TextBox></td>
								</tr>
								<tr>
									<td>
										<b>Mô tả</b></td>
									<td>
										<asp:TextBox Width="100%" TextMode="MultiLine" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Link_Description") %>'
											ID="txtDescription">
										</asp:TextBox></td>
								</tr>
							</table>
						</EditItemTemplate>
					</asp:TemplateField>
					<asp:TemplateField HeaderText="Thứ tự">
						<HeaderStyle Width="0%"></HeaderStyle>
						<HeaderTemplate>
							<asp:Button ID="Button1" CssClass="Button" runat="server" Width="50px" Text="Thứ tự"
								CommandName="sort"></asp:Button>
						</HeaderTemplate>
						<ItemTemplate>
							<asp:DropDownList ID="dropIndex" runat="server" Width="50px">
							</asp:DropDownList>
						</ItemTemplate>
					</asp:TemplateField>
					<asp:TemplateField>
						<HeaderStyle Width="5%"></HeaderStyle>
						<ItemStyle HorizontalAlign="Center"></ItemStyle>
						<ItemTemplate>
							<asp:Button runat="server" Text="Sửa" CssClass="Button" CommandName="Edit" CausesValidation="false">
							</asp:Button>
						</ItemTemplate>
						<EditItemTemplate>
							<asp:Button runat="server" Text="Ghi " CssClass="Button" CommandName="Update" ></asp:Button>&nbsp;
							<asp:Button runat="server" Text="Hủy" CssClass="Button" CommandName="Cancel" CausesValidation="false">
							</asp:Button>
						</EditItemTemplate>
					</asp:TemplateField>
					<asp:TemplateField>
						<HeaderStyle Width="5%"></HeaderStyle>
						<ItemStyle HorizontalAlign="Center"></ItemStyle>
						<ItemTemplate>
							<asp:Button id="btnDeleteLink" runat="server" Text="Xóa" CssClass="Button" CommandName="deletelink" CausesValidation="false" commandargument='<%# Eval("Link_ID") %>'>
							</asp:Button>
						</ItemTemplate>
					</asp:TemplateField>
				</Columns>
			</cc1:GridView>
		</td>
	</tr>
	<tr>
		<td height="5">
		</td>
	</tr>
	<tr>
		<td align="center" class="TextBox_Input">
			<b>Thêm mới
				<asp:TextBox ID="txtAddNew" runat="server"></asp:TextBox>
				<asp:Button ID="btnAddNew" runat="server" CssClass="Button" Text="Thêm" Width="62px" OnClick="btnAddNew_Click" /></b></td>
	</tr>
</table>
